package cn.terminus;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * ClassName: ApiApplication. <br/>
 * Description: HTTP网关. <br/>
 * Date: 2020-04-24. <br/>
 *
 * @author
 * @version 1.0.0
 * @since 1.7
 */
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages = {"cn.terminus.**.data.**.mapper"})
@RefreshScope
@EnableCaching
@EnableScheduling
@EnableFeignClients(basePackages = {"cn.terminus.service.**"})
public class ApiApplication {

    /**
     * 启动函数主入口
     *
     * @param args 启动参数
     **/
    public static void main(String[] args) {
        System.out.println("[特斯联-招商云-招商服务]-[cbo-customer] 开始启动...");

        SpringApplication app = new SpringApplication(ApiApplication.class);
        app.setBannerMode(Banner.Mode.OFF);
        ConfigurableApplicationContext context = app.run(args);

        String applicationName = context.getEnvironment().getProperty("spring.application.name");
        String port = context.getEnvironment().getProperty("server.port");

        System.out.println("[特斯联-招商云-招商服务]-[cbo-customer] 启动完成...服务名[" + applicationName + "] 端口[" + port + "]");

    }
}
